home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / gzip.z / gzip
Text File  |  1998-10-20  |  20KB  |  463 lines

  1.  
  2.  
  3.  
  4. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gzip, gunzip, gzcat - compress or expand files
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ggggzzzziiiipppp [ ----aaaaccccddddffffhhhhllllLLLLnnnnNNNNrrrrttttvvvvVVVV11119999 ] [----SSSS ssssuuuuffffffffiiiixxxx] [ _n_a_m_e ... ]
  13.      gggguuuunnnnzzzziiiipppp [ ----aaaaccccffffhhhhllllLLLLnnnnNNNNrrrrttttvvvvVVVV ] [----SSSS ssssuuuuffffffffiiiixxxx] [ _n_a_m_e ... ]
  14.      ggggzzzzccccaaaatttt [ ----ffffhhhhLLLLVVVV ] [ _n_a_m_e ... ]
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _G_z_i_p reduces the size of the named files using Lempel-Ziv coding (LZ77).
  18.      Whenever possible, each file is replaced by one with the extension ....ggggzzzz,,,,
  19.      while keeping the same ownership modes, access and modification times.
  20.      (The default extension is ----ggggzzzz for VMS, zzzz for MSDOS, OS/2 FAT, Windows NT
  21.      FAT and Atari.)  If no files are specified, or if a file name is "-", the
  22.      standard input is compressed to the standard output.  _G_z_i_p will only
  23.      attempt to compress regular files.  In particular, it will ignore
  24.      symbolic links.
  25.  
  26.      If the compressed file name is too long for its file system, _g_z_i_p
  27.      truncates it.  _G_z_i_p attempts to truncate only the parts of the file name
  28.      longer than 3 characters.  (A part is delimited by dots.) If the name
  29.      consists of small parts only, the longest parts are truncated. For
  30.      example, if file names are limited to 14 characters, gzip.msdos.exe is
  31.      compressed to gzi.msd.exe.gz.  Names are not truncated on systems which
  32.      do not have a limit on file name length.
  33.  
  34.      By default, _g_z_i_p keeps the original file name and timestamp in the
  35.      compressed file. These are used when decompressing the file with the ----NNNN
  36.      option. This is useful when the compressed file name was truncated or
  37.      when the time stamp was not preserved after a file transfer.
  38.  
  39.      Compressed files can be restored to their original form using _g_z_i_p -_d or
  40.      _g_u_n_z_i_p or _g_z_c_a_t. If the original name saved in the compressed file is not
  41.      suitable for its file system, a new name is constructed from the original
  42.      one to make it legal.
  43.  
  44.      _g_u_n_z_i_p takes a list of files on its command line and replaces each file
  45.      whose name ends with .gz, -gz, .z, -z, _z or .Z and which begins with the
  46.      correct magic number with an uncompressed file without the original
  47.      extension.  _g_u_n_z_i_p also recognizes the special extensions ....ttttggggzzzz and ....ttttaaaazzzz
  48.      as shorthands for ....ttttaaaarrrr....ggggzzzz and ....ttttaaaarrrr....ZZZZ respectively.  When compressing,
  49.      _g_z_i_p uses the ....ttttggggzzzz extension if necessary instead of truncating a file
  50.      with a ....ttttaaaarrrr extension.
  51.  
  52.      _g_u_n_z_i_p can currently decompress files created by _g_z_i_p, _z_i_p, _c_o_m_p_r_e_s_s,
  53.      _c_o_m_p_r_e_s_s -_H or _p_a_c_k. The detection of the input format is automatic.
  54.      When using the first two formats, _g_u_n_z_i_p checks a 32 bit CRC. For _p_a_c_k,
  55.      _g_u_n_z_i_p checks the uncompressed length. The standard _c_o_m_p_r_e_s_s format was
  56.      not designed to allow consistency checks. However _g_u_n_z_i_p is sometimes
  57.      able to detect a bad .Z file. If you get an error when uncompressing a .Z
  58.      file, do not assume that the .Z file is correct simply because the
  59.      standard _u_n_c_o_m_p_r_e_s_s does not complain. This generally means that the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  71.  
  72.  
  73.  
  74.      standard _u_n_c_o_m_p_r_e_s_s does not check its input, and happily generates
  75.      garbage output.  The SCO compress -H format (lzh compression method) does
  76.      not include a CRC but also allows some consistency checks.
  77.  
  78.      Files created by _z_i_p can be uncompressed by gzip only if they have a
  79.      single member compressed with the 'deflation' method. This feature is
  80.      only intended to help conversion of tar.zip files to the tar.gz format.
  81.      To extract zip files with several members, use _u_n_z_i_p instead of _g_u_n_z_i_p.
  82.  
  83.      _g_z_c_a_t is identical to _g_u_n_z_i_p ----cccc.... (On some systems, _z_c_a_t may be installed
  84.      as _g_z_c_a_t to preserve the original link to _c_o_m_p_r_e_s_s.) _g_z_c_a_t uncompresses
  85.      either a list of files on the command line or its standard input and
  86.      writes the uncompressed data on standard output.  _g_z_c_a_t will uncompress
  87.      files that have the correct magic number whether they have a ....ggggzzzz suffix
  88.      or not.
  89.  
  90.      _G_z_i_p uses the Lempel-Ziv algorithm used in _z_i_p and PKZIP.  The amount of
  91.      compression obtained depends on the size of the input and the
  92.      distribution of common substrings.  Typically, text such as source code
  93.      or English is reduced by 60-70%.  Compression is generally much better
  94.      than that achieved by LZW (as used in _c_o_m_p_r_e_s_s), Huffman coding (as used
  95.      in _p_a_c_k), or adaptive Huffman coding (_c_o_m_p_a_c_t).
  96.  
  97.      Compression is always performed, even if the compressed file is slightly
  98.      larger than the original. The worst case expansion is a few bytes for the
  99.      gzip file header, plus 5 bytes every 32K block, or an expansion ratio of
  100.      0.015% for large files. Note that the actual number of used disk blocks
  101.      almost never increases.  _g_z_i_p preserves the mode, ownership and
  102.      timestamps of files when compressing or decompressing.
  103.  
  104.  
  105. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  106.      ----aaaa --------aaaasssscccciiiiiiii
  107.           Ascii text mode: convert end-of-lines using local conventions. This
  108.           option is supported only on some non-Unix systems. For MSDOS, CR LF
  109.           is converted to LF when compressing, and LF is converted to CR LF
  110.           when decompressing.
  111.  
  112.      ----cccc --------ssssttttddddoooouuuutttt --------ttttoooo----ssssttttddddoooouuuutttt
  113.           Write output on standard output; keep original files unchanged.  If
  114.           there are several input files, the output consists of a sequence of
  115.           independently compressed members. To obtain better compression,
  116.           concatenate all input files before compressing them.
  117.  
  118.      ----dddd --------ddddeeeeccccoooommmmpppprrrreeeessssssss --------uuuunnnnccccoooommmmpppprrrreeeessssssss
  119.           Decompress.
  120.  
  121.      ----ffff --------ffffoooorrrrcccceeee
  122.           Force compression or decompression even if the file has multiple
  123.           links or the corresponding file already exists, or if the compressed
  124.           data is read from or written to a terminal. If the input data is not
  125.           in a format recognized by _g_z_i_p, and if the option --stdout is also
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  137.  
  138.  
  139.  
  140.           given, copy the input data without change to the standard ouput: let
  141.           _g_z_c_a_t behave as _c_a_t. If ----ffff is not given, and when not running in the
  142.           background, _g_z_i_p prompts to verify whether an existing file should
  143.           be overwritten.
  144.  
  145.      ----hhhh --------hhhheeeellllpppp
  146.           Display a help screen and quit.
  147.  
  148.      ----llll --------lllliiiisssstttt
  149.           For each compressed file, list the following fields:
  150.  
  151.               compressed size: size of the compressed file
  152.               uncompressed size: size of the uncompressed file
  153.               ratio: compression ratio (0.0% if unknown)
  154.               uncompressed_name: name of the uncompressed file
  155.  
  156.           The uncompressed size is given as -1 for files not in gzip format,
  157.           such as compressed .Z files. To get the uncompressed size for such a
  158.           file, you can use:
  159.  
  160.               gzcat file.Z | wc -c
  161.  
  162.           In combination with the --verbose option, the following fields are
  163.           also displayed:
  164.  
  165.               method: compression method
  166.               crc: the 32-bit CRC of the uncompressed data
  167.               date & time: time stamp for the uncompressed file
  168.  
  169.           The compression methods currently supported are deflate, compress,
  170.           lzh (SCO compress -H) and pack.  The crc is given as ffffffff for a
  171.           file not in gzip format.
  172.  
  173.           With --name, the uncompressed name,  date and time  are those stored
  174.           within the compress file if present.
  175.  
  176.           With --verbose, the size totals and compression ratio for all files
  177.           is also displayed, unless some sizes are unknown. With --quiet, the
  178.           title and totals lines are not displayed.
  179.  
  180.      ----LLLL --------lllliiiicccceeeennnnsssseeee
  181.           Display the _g_z_i_p license and quit.
  182.  
  183.      ----nnnn --------nnnnoooo----nnnnaaaammmmeeee
  184.           When compressing, do not save the original file name and time stamp
  185.           by default. (The original name is always saved if the name had to be
  186.           truncated.) When decompressing, do not restore the original file
  187.           name if present (remove only the _g_z_i_p suffix from the compressed
  188.           file name) and do not restore the original time stamp if present
  189.           (copy it from the compressed file). This option is the default when
  190.           decompressing.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  203.  
  204.  
  205.  
  206.      ----NNNN --------nnnnaaaammmmeeee
  207.           When compressing, always save the original file name and time stamp;
  208.           this is the default. When decompressing, restore the original file
  209.           name and time stamp if present. This option is useful on systems
  210.           which have a limit on file name length or when the time stamp has
  211.           been lost after a file transfer.
  212.  
  213.      ----qqqq --------qqqquuuuiiiieeeetttt
  214.           Suppress all warnings.
  215.  
  216.      ----rrrr --------rrrreeeeccccuuuurrrrssssiiiivvvveeee
  217.           Travel the directory structure recursively. If any of the file names
  218.           specified on the command line are directories, _g_z_i_p will descend
  219.           into the directory and compress all the files it finds there (or
  220.           decompress them in the case of _g_u_n_z_i_p ).
  221.  
  222.      ----SSSS ....ssssuuuuffff --------ssssuuuuffffffffiiiixxxx ....ssssuuuuffff
  223.           Use suffix .suf instead of .gz. Any suffix can be given, but
  224.           suffixes other than .z and .gz should be avoided to avoid confusion
  225.           when files are transferred to other systems.  A null suffix forces
  226.           gunzip to  try decompression on all given files regardless of
  227.           suffix, as in:
  228.  
  229.               gunzip -S "" *       (*.* for MSDOS)
  230.  
  231.           Previous versions of gzip used the .z suffix. This was changed to
  232.           avoid a conflict with _p_a_c_k(1).
  233.  
  234.      ----tttt --------tttteeeesssstttt
  235.           Test. Check the compressed file integrity.
  236.  
  237.      ----vvvv --------vvvveeeerrrrbbbboooosssseeee
  238.           Verbose. Display the name and percentage reduction for each file
  239.           compressed or decompressed.
  240.  
  241.      ----VVVV --------vvvveeeerrrrssssiiiioooonnnn
  242.           Version. Display the version number and compilation options then
  243.           quit.
  244.  
  245.      ----#### --------ffffaaaasssstttt --------bbbbeeeesssstttt
  246.           Regulate the speed of compression using the specified digit #, where
  247.           ----1111 or --------ffffaaaasssstttt indicates the fastest compression method (less
  248.           compression) and ----9999 or --------bbbbeeeesssstttt indicates the slowest compression
  249.           method (best compression).  The default compression level is ----6666
  250.           (that is, biased towards high compression at expense of speed).
  251.  
  252. AAAADDDDVVVVAAAANNNNCCCCEEEEDDDD UUUUSSSSAAAAGGGGEEEE
  253.      Multiple compressed files can be concatenated. In this case, _g_u_n_z_i_p will
  254.      extract all members at once. For example:
  255.  
  256.            gzip -c file1  > foo.gz
  257.            gzip -c file2 >> foo.gz
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  269.  
  270.  
  271.  
  272.      Then
  273.            gunzip -c foo
  274.  
  275.      is equivalent to
  276.  
  277.            cat file1 file2
  278.  
  279.      In case of damage to one member of a .gz file, other members can still be
  280.      recovered (if the damaged member is removed). However, you can get better
  281.      compression by compressing all members at once:
  282.  
  283.            cat file1 file2 | gzip > foo.gz
  284.  
  285.      compresses better than
  286.  
  287.            gzip -c file1 file2 > foo.gz
  288.  
  289.      If you want to recompress concatenated files to get better compression,
  290.      do:
  291.  
  292.            gzip -cd old.gz | gzip > new.gz
  293.  
  294.      If a compressed file consists of several members, the uncompressed size
  295.      and CRC reported by the --list option applies to the last member only. If
  296.      you need the uncompressed size for all members, you can use:
  297.  
  298.            gzip -cd file.gz | wc -c
  299.  
  300.      If you wish to create a single archive file with multiple members so that
  301.      members can later be extracted independently, use an archiver such as tar
  302.      or zip. GNU tar supports the -z option to invoke gzip transparently. gzip
  303.      is designed as a complement to tar, not as a replacement.
  304.  
  305. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  306.      The environment variable GGGGZZZZIIIIPPPP can hold a set of default options for _g_z_i_p.
  307.      These options are interpreted first and can be overwritten by explicit
  308.      command line parameters. For example:
  309.            for sh:    GZIP="-8v --name"; export GZIP
  310.            for csh:   setenv GZIP "-8v --name"
  311.            for MSDOS: set GZIP=-8v --name
  312.  
  313.      On Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid a
  314.      conflict with the symbol set for invocation of the program.
  315.  
  316. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  317.      compress(1), pack(1)
  318.  
  319. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  320.      Exit status is normally 0; if an error occurs, exit status is 1. If a
  321.      warning occurs, exit status is 2.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  335.  
  336.  
  337.  
  338.      Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
  339.              Invalid options were specified on the command line.
  340.      _f_i_l_e:  not in gzip format
  341.              The file specified to _g_u_n_z_i_p has not been compressed.
  342.      _f_i_l_e:  Corrupt input. Use gzcat to recover some data.
  343.              The compressed file has been damaged. The data up to the point of
  344.              failure can be recovered using
  345.                      gzcat file > recover
  346.      _f_i_l_e:  compressed with _x_x bits, can only handle _y_y bits
  347.              _F_i_l_e was compressed (using LZW) by a program that could deal with
  348.              more _b_i_t_s than the decompress code on this machine.  Recompress
  349.              the file with gzip, which compresses better and uses less memory.
  350.      _f_i_l_e:  already has .gz suffix -- no change
  351.              The file is assumed to be already compressed.  Rename the file
  352.              and try again.
  353.      _f_i_l_e already exists; do you wish to overwrite (y or n)?
  354.              Respond "y" if you want the output file to be replaced; "n" if
  355.              not.
  356.      gunzip: corrupt input
  357.              A SIGSEGV violation was detected which usually means that the
  358.              input file has been corrupted.
  359.      _x_x._x%
  360.              Percentage of the input saved by compression.  (Relevant only for
  361.              ----vvvv and ----llll.)
  362.      -- not a regular file or directory: ignored
  363.              When the input file is not a regular file or directory, (e.g. a
  364.              symbolic link, socket, FIFO, device file), it is left unaltered.
  365.      -- has _x_x other links: unchanged
  366.              The input file has links; it is left unchanged.  See _l_n(1) for
  367.              more information. Use the ----ffff flag to force compression of
  368.              multiply-linked files.
  369.  
  370. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  371.      When writing compressed data to a tape, it is generally necessary to pad
  372.      the output with zeroes up to a block boundary. When the data is read and
  373.      the whole block is passed to _g_u_n_z_i_p for decompression, _g_u_n_z_i_p detects
  374.      that there is extra trailing garbage after the compressed data and emits
  375.      a warning by default. You have to use the --quiet option to suppress the
  376.      warning. This option can be set in the GGGGZZZZIIIIPPPP environment variable as in:
  377.        for sh:  GZIP="-q"  tar -xfz --block-compress /dev/rst0
  378.        for csh: (setenv GZIP -q; tar -xfz --block-compr /dev/rst0
  379.  
  380.      In the above example, gzip is invoked implicitly by the -z option of GNU
  381.      tar. Make sure that the same block size (-b option of tar) is used for
  382.      reading and writing compressed data on tapes.  (This example assumes you
  383.      are using the GNU version of tar.)
  384.  
  385. BBBBUUUUGGGGSSSS
  386.      The --list option reports incorrect sizes if they exceed 2 gigabytes.
  387.      The --list option reports sizes as -1 and crc as ffffffff if the
  388.      compressed file is on a non seekable media.
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. GGGGZZZZIIIIPPPP((((1111))))                                                                GGGGZZZZIIIIPPPP((((1111))))
  401.  
  402.  
  403.  
  404.      In some rare cases, the --best option gives worse compression than the
  405.      default compression level (-6). On some highly redundant files, _c_o_m_p_r_e_s_s
  406.      compresses better than _g_z_i_p.
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.